package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ActivityCategoryMapper;
import com.ruoyi.system.domain.ActivityCategory;
import com.ruoyi.system.service.IActivityCategoryService;

/**
 * 活动分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-26
 */
@Service
public class ActivityCategoryServiceImpl implements IActivityCategoryService 
{
    @Autowired
    private ActivityCategoryMapper activityCategoryMapper;

    /**
     * 查询活动分类
     * 
     * @param categoryId 活动分类主键
     * @return 活动分类
     */
    @Override
    public ActivityCategory selectActivityCategoryByCategoryId(Long categoryId)
    {
        return activityCategoryMapper.selectActivityCategoryByCategoryId(categoryId);
    }

    /**
     * 查询活动分类列表
     * 
     * @param activityCategory 活动分类
     * @return 活动分类
     */
    @Override
    public List<ActivityCategory> selectActivityCategoryList(ActivityCategory activityCategory)
    {
        return activityCategoryMapper.selectActivityCategoryList(activityCategory);
    }

    /**
     * 新增活动分类
     * 
     * @param activityCategory 活动分类
     * @return 结果
     */
    @Override
    public int insertActivityCategory(ActivityCategory activityCategory)
    {
        activityCategory.setCreateTime(DateUtils.getNowDate());
        return activityCategoryMapper.insertActivityCategory(activityCategory);
    }

    /**
     * 修改活动分类
     * 
     * @param activityCategory 活动分类
     * @return 结果
     */
    @Override
    public int updateActivityCategory(ActivityCategory activityCategory)
    {
        activityCategory.setUpdateTime(DateUtils.getNowDate());
        return activityCategoryMapper.updateActivityCategory(activityCategory);
    }

    /**
     * 批量删除活动分类
     * 
     * @param categoryIds 需要删除的活动分类主键
     * @return 结果
     */
    @Override
    public int deleteActivityCategoryByCategoryIds(Long[] categoryIds)
    {
        return activityCategoryMapper.deleteActivityCategoryByCategoryIds(categoryIds);
    }

    /**
     * 删除活动分类信息
     * 
     * @param categoryId 活动分类主键
     * @return 结果
     */
    @Override
    public int deleteActivityCategoryByCategoryId(Long categoryId)
    {
        return activityCategoryMapper.deleteActivityCategoryByCategoryId(categoryId);
    }
}
